﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DAO;
using Domain;

public partial class Adminlogin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void btn_login_Click(object sender, EventArgs e)
    {
        ul_errores.InnerHtml = string.Empty;

        if (string.IsNullOrEmpty(txt_pass.Text))
        {
            ul_errores.InnerHtml += "<li class='itemerror'>" + "Debe ingresar la contraseña" + "</li>";
            return;
        }

        if (txt_pass.Text.Trim() != ConfigurationManager.AppSettings["adminpassword"].ToString())
        { 
            ul_errores.InnerHtml += "<li class='itemerror'>" + "Contraseña errónea" + "</li>";
            return;
        }

        Response.Redirect(Utils.SecureRedirect("~/AdminPublicaciones.aspx"));

    }
}
